package com.youhong.teethcare

import android.content.Intent
import android.os.Bundle
import com.youhong.teethcare.utils.Util

import kotlinx.android.synthetic.main.activity_more.*

class MoreActivity : BaseActivity() {
    companion object{
      const val  privacyUrlCn="https://h5.le-young.com/medical/JCLife_privacy_policy_zh"
      const val  privacyUrlEn="https://h5.le-young.com/medical/JCLife_privacy_policy_en"
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_more)
        initStatusBar(resources.getColor(R.color.pageBackground), true)
        aboutUs_iv_back.setOnClickListener { finish() }
        btMoreCommonProblem.setOnClickListener {
            startActivity(CommonProblemActivity::class.java)
        }
        btMoreFirmware.setOnClickListener {
            startActivity(FirmwareUpdateActivity::class.java)
        }
        btMoreBrushingSteps.setOnClickListener {
            startActivity(BrushingStepsActivity.keyInfo, BrushingStepsActivity.infoType_BrushingSteps, BrushingStepsActivity::class.java) }
        btMoreInstructions.setOnClickListener {
            startActivity(BrushingStepsActivity.keyInfo, BrushingStepsActivity.infoType_Instructions, BrushingStepsActivity::class.java) }


        btMorePrivacyPolicy.setOnClickListener {
            val privacyUrl: String = if (Util.isZh(this)) privacyUrlCn else privacyUrlEn
            val intent = Intent(this, PrivacyActivity::class.java)
            intent.putExtra(PrivacyActivity.Key_urlType, 0)
            intent.putExtra(PrivacyActivity.Key_url, privacyUrl)
            startActivity(intent)
        }
    }
}